<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="DiaCreateDlg" widgetVar="DiaCreateDialog" modal="true" resizable="false" appendToBody="true" header="#{bundle.CreateDiaTitle}">

            <h:form id="DiaCreateForm">

                <h:panelGroup id="display">
                    <p:panelGrid columns="2" rendered="#{diaController.selected != null}">

                        <h:outputLabel value="#{bundle.CreateDiaLabel_diaPK_fecha}" for="diaPK_fecha" />
                        <p:calendar id="diaPK_fecha" pattern="MM/dd/yyyy HH:mm:ss" value="#{diaController.selected.diaPK.fecha}" title="#{bundle.EditDiaTitle_diaPK_fecha}" required="true" requiredMessage="#{bundle.EditDiaRequiredMessage_diaPK_fecha}" showOn="button"/>

                        <h:outputLabel value="#{bundle.CreateDiaLabel_observacion}" for="observacion" />
                        <p:inputText id="observacion" value="#{diaController.selected.observacion}" title="#{bundle.CreateDiaTitle_observacion}" />

                        <h:outputLabel value="#{bundle.CreateDiaLabel_estadoidEstado}" for="estadoidEstado" />
                        <p:selectOneMenu id="estadoidEstado" value="#{diaController.selected.estadoidEstado}" required="true" requiredMessage="#{bundle.EditDiaRequiredMessage_estadoidEstado}">
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{estadoController.items}"
                                           var="estadoidEstadoItem"
                                           itemValue="#{estadoidEstadoItem}"
                                           itemLabel="#{estadoidEstadoItem.descripcion.toString()}"
                                           />
                            <f:converter binding="#{estadoConverter}"/>
                        </p:selectOneMenu>

                        <h:outputLabel value="#{bundle.CreateDiaLabel_turnoidTurno}" for="turnoidTurno" />
                        <p:selectOneMenu id="turnoidTurno" value="#{diaController.selected.turnoidTurno}" required="true" requiredMessage="#{bundle.EditDiaRequiredMessage_turnoidTurno}">
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{turnoController.items}"
                                           var="turnoidTurnoItem"
                                           itemValue="#{turnoidTurnoItem}"
                                           itemLabel="#{turnoidTurnoItem.descripcion.toString()}"
                                           />
                            <f:converter binding="#{turnoConverter}"/>
                        </p:selectOneMenu>

                        <h:outputLabel value="#{bundle.CreateDiaLabel_empleado}" for="empleado" />
                        <p:selectOneMenu id="empleado" value="#{diaController.selected.empleado}" required="true" requiredMessage="#{bundle.EditDiaRequiredMessage_empleado}">
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{empleadoController.items}"
                                           var="empleadoItem"
                                           itemValue="#{empleadoItem}"
                                           itemLabel="#{empleadoItem.idEmpleado.toString()}"
                                           />
                            <f:converter binding="#{empleadoConverter}"/>
                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{diaController.saveNew}" value="#{bundle.Save}" update="display,:DiaListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,DiaCreateDialog);"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="DiaCreateDialog.hide()"/>
                </h:panelGroup>

            </h:form>

        </p:dialog>

    </ui:composition>

</html>
